# -*-coding = utf-8 -*-
# @Time : 2022/10/11 19:24
# @Author : Oliver
# @File : 传送门.py
# @Software :PyCharm
length = input()
arr = list(map(int, input().split()))
# arr=[2 3 1 1 2 0 1 1]
# arr=[2 3 1 1 4]
minOp = 0


def goFurther(pos):
    global minOp
    if pos == 1:
        minOp += 1
        return
    currFurther = pos
    for i in range(pos, -1, -1):
        if arr[i] + i >= pos:
            currFurther = i
    minOp += 1
    goFurther(currFurther)


goFurther(len(arr) - 1)
print(minOp)
